#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QCoreApplication>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QProgressBar>
#include <QMessageBox>
#include <QFile>

namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();
    void downloadFile(const QString &url, const QString &path);
private slots:
    void downloadFinished(QNetworkReply *reply);
    void updateProgress(qint64 bytesReceived, qint64 bytesTotal);

private:
    QProgressBar *progressBar; // progress bar for displaying download progress
    QNetworkAccessManager *manager; // network access manager for handling downloads
    Ui::Widget *ui;

};

#endif // WIDGET_H
